using System;
using BlogEngine.Core;
using BlogEngine.MongoDbProvider;
using NUnit.Framework;
using SharpTestsEx;
using BlogEngine.Core.Providers;
namespace Providers.Specs
{
    [TestFixture]
    public class MongoDbProvider_specifications
    {
        [Test]
        public void When_saving_a_post_and_loading_it_again_Should_have_the_same_id()
        {
            BlogProvider provider = new MongoDbProvider();
            var post = new Post
                           {
                               Title = string.Format("The title of my post for today {0}", DateTime.Now)
                           };
            provider.InsertPost(post);

           var savedPost = provider.SelectPost(post.Id);
           savedPost.Id.Should().Be.EqualTo(post.Id);
        }
    }
}